<?php
/**
 * 管理端登陆后首页
 * 
 * @author:  will.lee <im.will.lee@gmail.com>
 * @version: 1.0
 */
 
class DashboardAction extends AdminAction
{
    // 允许访问节点
    protected $allow    = array('index','home');
    
    /**
     * 管理端登陆后首页
     */
    public function index()
    {
        // 导航菜单生成
        $this->assign('menu_json',D('Node')->initAdminMenuJson());
        $this->display();
    }
    
    /**
     * 后台首页
     */
    public function home()
    {
        $mysql_version = null;
        $db      = new Model();
        $result  = $db->query('SELECT VERSION() AS version;');
        if(!empty($result[0]['version']))
        {
            $mysql_version = $result[0]['version'];
        }
        // 服务器信息
        $server_info = array
        (
            '网站路径'      => WWW_ROOT,
            '操作系统'      => PHP_OS,
            '服务器端信息'  => $_SERVER["SERVER_SOFTWARE"],
            'PHP版本'      => PHP_VERSION,
            'MYSQL版本'    => $mysql_version,
            '最大上传限制'  => ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'Disabled',
            '最大执行时间'  => intval(ini_get('max_execution_time')) . ' seconds',
        );
        $developer_info = array
        (
            '开发者'      => 'Will Lee',
            '联系邮箱'    => 'im.will.lee@gmail.com',
            '项目主页'    => ''
        );
        $this->assign(compact('server_info','developer_info'));
        $this->display();
    }
}